package com.lg.erp.service.impl.wangyu;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.lg.erp.entity.wangyu.TDepartmentWy;
import com.lg.erp.entity.wangyu.WyTProduct;
import com.lg.erp.entity.wangyu.TPurchaseOrder;
import com.lg.erp.entity.wangyu.TStaffWy;
import com.lg.erp.mapper.wangyu.wyOrderMapper;
import com.lg.erp.service.wangyu.ITPurchaseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TPurchaseOrderServiceImpl extends ServiceImpl<wyOrderMapper, TPurchaseOrder> implements ITPurchaseOrderService {
    @Autowired
    private wyOrderMapper mapper;

    @Override
    public List<TStaffWy> getStaffs() {
        return mapper.selectStaffs();
    }

    @Override
    public List<TDepartmentWy> getDepartments() {
        return mapper.selectDepartment();
    }

    @Override
    public List<TDepartmentWy> getDepartmentNames() {
        return mapper.selectDepartmentNames();
    }

    @Override
    public IPage<TPurchaseOrder> getOrderByPage(Page<TPurchaseOrder> page) {
        return mapper.selectOrderByPage(page);
    }

    @Override
    public IPage<WyTProduct> getAll(String id,Page<WyTProduct> page) {
        return mapper.selectAll(id,page);
    }

    @Override
    public void alterById(TPurchaseOrder order) {
        mapper.updateIdById(order);
    }

    @Override
    public void alterStatusById(TPurchaseOrder order) {
        mapper.updateStatusById(order);
    }
}
